import Layout from "@/layout";
//常量路由
export const constantRoutes = [
  {
    path: "/login",
    component: () => import("@/views/login/index"),
    hidden: true,
  },

  {
    path: "/404",
    component: () => import("@/views/404"),
    hidden: true,
  },

  {
    path: "/",
    component: Layout,
    redirect: "/home",
    children: [
      {
        path: "home",
        name: "Home",
        component: () => import("@/views/Home/index"),
        meta: { title: "主页", icon: "el-icon-s-home" },
      },
    ],
  },
];
//所有的动态异步路由
export const allAsyncRoutes = [
  {
    // 商品管理路由Start
    path: "/product",
    component: Layout,
    redirect: "/product/trademark/list",
    meta: { title: "商品管理", icon: "el-icon-s-shop" },
    children: [
      {
        path: "trademark/list",
        name: "Trademark",
        component: () => import("@/views/Product/Trademark"),
        meta: { title: "品牌列表" },
      },
      {
        path: "attrattr/list",
        name: "Attr",
        component: () => import("@/views/Product/Attr"),
        meta: { title: "平台属性" },
      },
      {
        path: "sku/list",
        name: "Sku",
        component: () => import("@/views/Product/Sku"),
        meta: { title: "SKU管理" },
      },
      {
        path: "spu/list",
        name: "Spu",
        component: () => import("@/views/Product/Spu"),
        meta: { title: "SPU管理" },
      },
    ],
  }, //  商品管理路由End
  {
    //  权限管理路由Start
    path: "/acl",
    component: Layout,
    redirect: "/acl/user/list",
    meta: { title: "权限管理", icon: "el-icon-setting" },
    children: [
      {
        path: "user/list",
        name: "User",
        component: () => import("@/views/Acl/User"),
        meta: { title: "用户管理" },
      },
      {
        path: "role/list",
        name: "Role",
        component: () => import("@/views/Acl/Role"),
        meta: { title: "角色管理" },
      },
      {
        path: "permission/list",
        name: "Permission",
        component: () => import("@/views/Acl/Permission"),
        meta: { title: "菜单管理" },
      },
      {
        path: "role/auth",
        name: "Auth",
        component: () => import("@/views/Acl/Auth"),
        hidden: true,
        meta: { title: "权限分配" },
      },
    ],
  }, //权限管理路由End
];
//通配路由
export const anyRoute = { path: '*', redirect: '/404', hidden: true }
